package com.gxc.mq;

import com.gxc.config.TopicQueueConfigBean;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author GongXincheng
 * @since 2019-08-23 10:22
 */
@Slf4j
@Component
@RabbitListener(queues = TopicQueueConfigBean.MESSAGES_QUEUE)
public class Demo4_Consumer_2 {

    @RabbitHandler
    public void process(String message) {
        System.out.println("["+TopicQueueConfigBean.MESSAGES_QUEUE+"] -> get message：" + message);
    }

}
